//
//  PeerConnectionsController.h
//  SolarSeek
//
//  Created by Erick Fejta on 05/02/10.
//  Copyright 2005 Erick Fejta. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class SolarSeekEngine;
@class ServerConnection;
@class Peer;
@class PeersController;
@class PeerConnection;
@class ConnectionsIdentifier;

@interface PeerConnectionsController : NSObject {
	SolarSeekEngine *_engine;
	NSMutableDictionary *_addresses;
	ConnectionsIdentifier *_connectionsIdentifier;
	NSMutableDictionary *_tokensPeerConnectRequest;
	NSMutableSet *_peerConnections;
	NSMutableSet *_peerConnectionsConnected;
	NSMutableSet *_peerConnectionsConnecting;
	PeersController *_peersController;
	ServerConnection *_serverConnection;
	
	PeerConnection *_peerConnectionWithNewMessage;
	PeerConnection *_peerConnectionUnableToConnect;
}

- (id)initWithEngine:(SolarSeekEngine *)engine;

- (void)requestAddressForPeerConnection:(PeerConnection *)peerConnection;

- (PeerConnection *)peerConnectionForPeer:(Peer *)peer;
- (PeerConnection *)peerConnectionForName:(NSString *)namePeer;

- (PeerConnection *)peerConnectionWithNewMessage;
- (PeerConnection *)peerConnectionUnableToConnect;
@end
